[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
   SCROLLER()               Hotkey Lookup tables

Preamble               Scroller was originally designed as a means to
                       call up a LOOKUP table from a field by pressing a
                       HOTKEY.

                       For instance, I'm editing the ORDERS dbf
                       and I'm in the field SALESMAN. By pressing F2 I
                       get a LOOKUP box of the SALESMAN dbf. By selecting
                       the salesman I want and pressing <ENTER>, I get the
                       value KEYBOARDed back into the SALESMAN field, and
                       I continue on with my edit.

                       For dynamic-ness , and to conserve on space, the
                       paramaters for each field lookup can be stored in
                       a DBF called SCROLLER.DBF. SCROLLER.DBF contains
                       the key fields PROC and VAR, which allow me to
                       find a matching record for the current PROC and
                       VAR whenever the SET KEY is pressed.

                       Other paramaters contained in SCROLLER.DBF include
                       the display string (what shows in the lookup box),
                       the return string (what gets KEYBOARDed back to the
                       calling program), the datafile to use - if different
                       from the current DBF, the index to use, and a
                       description field used as a header.

                       A sample call would go like this:
                           << key F2 is set to SCROLLER()
                           << CUSTOMER.DBF is being edited
                           << procname is EDIT_CUS
                           << current field is PRODUCT

                            user presses F2
                            SCROLLER() is called with the params
                              "EDIT_CUS",32,"PRODUCT"
                              (the middle param is not important
                               but SET KEY passes it )
                            SCROLLER() opens the dbf SCROLLER.DBF
                            SCROLLER() finds a matching record for
                               this PROC and VARIABLE
                               ("EDIT_CUS", "PRODUCT")
                            SCROLLER() gets the DBF,INDEX,DISPLAY
                              STRING,RETURN STRING and HEADER from
                              SCROLLER.DBF
                            SCROLLER then opens the lookup dbf -
                              a file called PRODUCTS.DBF, and
                              generates a lookup table from the
                              paramaters.
                            user selects "PINEAPPLE"
                            "PINEAPPLE" is sent to the keyboard
                            SCROLLER() closes the lookup datafile
                              and returns to the current work area.
                            The PRODUCT field fills with the value
                              PINEAPPLE.
                            The user continues editing.

                       While this is still the primary use for SCROLLER,
                       it has others. For instance, while doing
                       full screen editing on a database with the famous
                       " Next  Previous  First  Last " menu, you can add
                       Scroll as a menu option, allowing the user to do
                       a fast table lookup of the current database. In
                       this instance, no value is returned, but the
                       record pointer is moved to the selected record.

Usage                  SCROLLER(<char>,<num>,<char>,<char>,<char>,<char>
                                             <char>,<char> )

Params                 ALL Optional
                       1. <char>   calling procedure
                       2. <num>    line number called from
                       3. <char>   variable name called from
                       4. <char>   lookup box display line
                       5. <char>   lookup box value to keyboard
                       6. <char>   dbf file to do lookup into
                       7. <char>   index file to use with lookup dbf
                       8. <char>   description - used as box header

Calling                Scroller can be called in three ways.

                       1. By calling it as a SET KEY, as described above.
                          Scroller will then be passed proc,line,var
                          by the calling procedure.

                          Proc and Var are searched for in a dbf called
                          SCROLLER.DBF. The additional paramaters are
                          then gotten from the DBF.

                          i.e. SET KEY -1 to SCROLLER        && F2

                      **  SCROLLER.DBF is built and maintained online
                          by SCMOD().  (see above)

                       2. By calling it directly with the paramaters
                          required. In this case, the first three
                          paramaters can be nulls, and you can pass as
                          many of the rest as needed.

                 examples:

                 scroller('','','', "LASTNAME+' '+FIRSTNAME")
                     - current dbf, lookup on LASTNAME+' '+FIRSTNAME
                     - nothing keyboarded
                 scroller('','','', "PRODUCT","PRODUCT+chr(13)","PRODUCTS")
                     - PRODUCTS dbf, lookup on PRODUCT, keyboard the value
                       in PRODUCT if selected.


                       3. By calling it directly with no paramaters.
                          The user will be prompted for what database
                          to do a lookup into - including the current.

                          example:

                          scroller()

Suggestions            Ease into SCROLLER()
                       First just open a DBF and call it with
                       no paramaters. (third method)
                       SCROLLER()

                       Next, call it by the second method
                       SCROLLER('','','',"[fieldname]" )

                       And so on.

This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson